//
//  QDLifeTableHeaderView.h
//  QDMetroClient
//
//  Created by YueWen on 2019/2/18.
//  Copyright © 2019 YueWen. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "QDCarouselItem.h"
#import "RITLSDCycleScrollView.h"

NS_ASSUME_NONNULL_BEGIN

FOUNDATION_EXTERN CGFloat QDLifeTableHeaderViewHeight(BOOL hasCycle,BOOL hasItems, BOOL hasAd);

@class QDLifeTableHeaderView;
@protocol HeziBannerOpenActivePageDelegate;

@protocol QDLifeTableHeaderViewAction <NSObject>

@optional

/// 进行响应的回调模式
- (void)qdLifeTableHeaderView:(QDLifeTableHeaderView *)headerView bannerIndex:(NSInteger)index;
- (void)qdLifeTableHeaderView:(QDLifeTableHeaderView *)headerView itemIndex:(NSInteger)index;
- (void)qdLifeTableHeaderView:(QDLifeTableHeaderView *)headerView adIndex:(NSInteger)index;

@end


/// 在生活圈界面放置轮播的header
@interface QDLifeTableHeaderView : UIView

/// 响应者
@property (nonatomic, weak, nullable)id <QDLifeTableHeaderViewAction> actor;
/// 盒子响应者
@property (nonatomic, weak, nullable)id <HeziBannerOpenActivePageDelegate> heziDelegate;
/// 轮播视图
@property (nonatomic, strong) RITLSDCycleScrollView *cycleView;
/// 子模块视图
@property (nonatomic, strong) RITLSDCycleScrollView *itemsView;
/// 广告视图
@property (nonatomic, strong) RITLSDCycleScrollView *adsView;

/// 更新数据，轮播、子模块、广告位
- (void)updateWithItems:(__kindof NSArray <QDCarouselItem *> *)carouses
                  items:(__kindof NSArray <QDCarouselItem *> *)items
               complete:(void(^)(QDLifeTableHeaderView *view))complete;

- (void)updateWithItems:(__kindof NSArray <QDCarouselItem *> *)carouses
                  items:(__kindof NSArray <QDCarouselItem *> *)items
                    ads:(__kindof NSArray <QDCarouselItem *> *)ads
               complete:(void(^)(QDLifeTableHeaderView *view))complete;

@end

NS_ASSUME_NONNULL_END
